<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-deletelog-edit">
			<div class="col-md-12">
				<div class="form-group">
					<label class="col-sm-3 control-label">执行器：</label>
					<div class="col-sm-9">
					   
						<input type="text" name="jobGroupText" class="form-control"
							th:value="${jobGroupText}" readonly> <input type="hidden"
							name="jobGroup" th:value="${jobGroup}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">任务：</label>
					<div class="col-sm-9">
						<input type="text" name="jobIdText" class="form-control"
							th:value="${jobIdText}" readonly> <input type="hidden"
							name="jobId" th:value="${jobId}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">项目：</label>
					<div class="col-sm-9">
						<input type="text" name="projectText" class="form-control"
							th:value="${projectText}" readonly>
							<input type="hidden"
							name="projectId" th:value="${projectId}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">清理方式：</label>
					<div class="col-sm-9">
						<select class="form-control" name="type">
							<option value="1">清理一个月之前日志数据</option>
							<option value="2">清理三个月之前日志数据</option>
							<option value="3">清理六个月之前日志数据</option>
							<option value="4">清理一年之前日志数据</option>
							<option value="5">清理一千条以前日志数据</option>
							<option value="6">清理一万条以前日志数据</option>
							<option value="7">清理三万条以前日志数据</option>
							<option value="8">清理十万条以前日志数据</option>
							<option value="9">清理所有日志数据</option>
						</select>
					</div>
				</div>
			</div>
		</form>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript">
		var prefix = ctx + "job/joblog";
		$("#form-post-edit").validate({
			rules : {
			},
			messages : {
			}
		});

		function submitHandler() {
			if ($.validate.form()) {
				 $.modal.confirm("确定清除日志吗？", function() {
						$.ajax({
							type : 'post',
							url:  prefix + "/clearLog",
							async: false,  
							data : $('#form-deletelog-edit').serialize(),
					        dataType : "json", 
							success : function(result) {
								if (result.code == web_status.SUCCESS) {
				                	$.modal.msgSuccess("清除日志成功");
				                	 $.modal.close();
				                     window.parent.$.modal.msgSuccess(result.msg);
				                     window.parent.$.table.refresh();
				                } else {
				                	 window.parent.$.modal.msgError(result.msg);
				                }
							}
						});
					});
			}
		}
	</script>
</body>
</html>
